package conf

import (
	"time"
)

type Bootstrap struct {
	Server *Server `yaml:"server"`
	Data   *Data   `yaml:"data"`
}

type Server struct {
	Http *Http `yaml:"http"`
}

type Http struct {
	Network string        `yaml:"network"`
	Addr    string        `yaml:"addr"`
	Timeout time.Duration `yaml:"timeout"`
}

type Data struct {
	Redis   *Redis   `yaml:"redis"`
	Session *Session `yaml:"session"`
	Stream  *Stream  `yaml:"stream"`
	Ansible *Ansible `yaml:"ansible"`
}

type Redis struct {
	Addr     string `yaml:"addr"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

// Session session配置
type Session struct {
	Redis  `yaml:",inline"`
	Secret string `yaml:"secret"`
}

type Stream struct {
	LogDir string `yaml:"log_dir"`
}

type Ansible struct {
	WorkDir   string `yaml:"work_dir"`
	Inventory string `yaml:"inventory"`
	Playbook  string `yaml:"playbook"`
}
